package com.vmj.classfile.entity.attribute;

import com.vmj.classfile.ClassReader;

/**
 * Created by yangshoujun on 2017/8/6 下午3:34.
 */
public class ExceptionsAttribute extends AbstractAttribute {

    private int[] exceptionIndexTable; //[] u2

    public ExceptionsAttribute(ClassReader classReader) {
        super(classReader);
    }

    public void parse() {
        int count = getClassReader().readTwoByte();
        int[] data = new int[count];
        for(int i = 0;i < count;i++) {
            data[i] = getClassReader().readTwoByte();
        }
        exceptionIndexTable = data;
    }

    public void setExceptionIndexTable(int[] exceptionIndexTable) {
        this.exceptionIndexTable = exceptionIndexTable;
    }

    public int[] getExceptionIndexTable() {
        return exceptionIndexTable;
    }

}
